#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int main()
{
    int n;
    char c;
    cin >> n >> c;
    int row = (int)sqrt((n + 1) / 2);
    int surplus = n - (2 * row * row - 1); // 记录剩下的字符数
    bool control = false;
    int max = 2 * row - 1; // 一行打印最多的字符个数
    int num = max, count = 0; // 分别控制打印多少个c，多少个空格
    
    // 开始打印
    while (num <= max)
    {
        for (int i = 0; i < count; ++i)
            cout << ' ';
        for (int i = 0; i < num; ++i)
            cout << c;
        cout << endl;
        if (num == 1)
            control = true;

        if (!control)
        {
            num -= 2;
            ++count;
        }
        else
        {
            num += 2;
            --count;
        }
    }
    if (surplus)
        cout << surplus;

    return 0;
}
